package server;

import java.io.IOException;

public class LagouServlet extends HttpServlet {


    @Override
    public void doGet(Request request, Response response) {
        String context = "<h1>GET 方法</h1>";
        try {
            response.outPut(HttpProtocolUtil.getHttpHeader200(context.getBytes().length)+context);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    @Override
    public void doPost(Request request, Response response) {
        String context = "<h1>POST 方法</h1>";
        try {
            response.outPut(HttpProtocolUtil.getHttpHeader200(context.getBytes().length)+context);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    @Override
    public void init() throws Exception {

    }

    @Override
    public void destory() throws Exception {

    }
}
